﻿Imports ajayumi.develop.win32.GameEditor.Base

Public Class ucController

    Private m_Game As IGame = Nothing
    Public WriteOnly Property Game() As IGame
        Set(ByVal value As IGame)
            m_Game = value
        End Set
    End Property


    Private Sub ucController_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.btnSun.Text = String.Format("修改阳光为{0}", My.Settings.Sun)
        Me.btnUnlimitedBuild.Text = String.Format("无冷却时间")
    End Sub

    Private Sub btnSun_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSun.Click
        Try
            DirectCast(Me.m_Game, PlantsVsZombies).ChangeSun(My.Settings.Sun)
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub btnUnlimitedBuild_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUnlimitedBuild.Click
        Try
            DirectCast(Me.m_Game, PlantsVsZombies).UnlimitedBuild()
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class
